[deps]

[mirrors]
http://www.yassl.com/altpkg/cyassl-2.8.0.tar.xz

[main]
filesize=723208
sha512=e21c3ed26f059ca0563d376e5cf9d6dc66416b9e017e71bcd5513425b8a22eac3315da3a001602fb2d250f53856d4759b693412eb95b040b72eee6a8b2ca29ab

[build]
patch -p1 < "$K"/cyassl-280-ERR_reason.patch || exit 1

debug_flags=
[ "$DEBUGBUILD" = 1 ] && debug_flags=--enable-debug

C_EXTRA_FLAGS="-D_GNU_SOURCE $optcflags" \
./configure --prefix="$butch_prefix" --enable-dtls --enable-opensslExtra \
  --enable-static $debug_flags \
  --disable-silent-rules \
  --enable-ipv6 --enable-ripemd --enable-sha512 \
  --enable-sessioncerts --enable-certgen || exit 1
# aesni is only for cpus with aes extension, amd bulldozer+ or corei7ish
# sniffer depends on pcap

make -j$MAKE_THREADS || exit 1
make DESTDIR="$butch_install_dir" install || exit 1

if false ; then
	# this was an attempt to use cyassl's openssl compatibility layer
	# however it is not fit for this yet.
	ln -sf cyassl/openssl/ "$butch_install_dir/include/"

	ln -sf libcyassl.a "$butch_install_dir/lib/libssl.a"
	ln -sf libcyassl.a "$butch_install_dir/lib/libcrypto.a"

	ln -sf libcyassl.so "$butch_install_dir/lib/libssl.so"
	ln -sf libcyassl.so "$butch_install_dir/lib/libssl.so.1.0.0"

	ln -sf libcyassl.so "$butch_install_dir/lib/libcrypto.so"
	ln -sf libcyassl.so "$butch_install_dir/lib/libcrypto.so.1.0.0"
fi

